library(p8105.datasets)
data("instacart")
view("instacart")
bar plots: Top Aisles by Number of Items Ordered (n>10000)
instacart |>
group_by(aisle) |>
summarize(items = n()) |>
filter(items > 10000) |>
plot_ly(x = ~aisle, y = ~items, color = ~aisle, type = "bar")
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
box plot: Distribution of Add-to-Cart Order by Department
instacart |>
plot_ly(
x = ~department, y = ~add_to_cart_order, type = "box",color = ~department)
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors